<template>
  <div>
    <BasicModal
      v-bind="$attrs"
      :title="t('routes.components.structuralDescriptionModal.structuralDescription')"
      @register="register"
      @ok="handleSubmit"
      @cancel="handleCancel"
      :destroyOnClose="true"
      :minHeight="400"
      :width="800"
    >
      <BasicForm @register="registerForm" />
    </BasicModal>
  </div>
</template>

<script setup lang="ts">
  import { BasicModal, useModalInner } from '/@/components/Modal';
  import { BasicForm, useForm } from '/@/components/Form';
  import { useI18n } from '/@/hooks/web/useI18n';
  import { getStructureDesForm } from './tableData';

  const { t } = useI18n();

  const handleSubmit = () => {
    handleCancel();
  };

  const handleCancel = () => {
    closeModal();
  };

  // 初始化弹窗
  const [register, { setModalProps, closeModal }] = useModalInner(() => {
    setModalProps({ confirmLoading: false });
  });

  // 初始化表格
  const [registerForm, { validate }] = useForm({
    labelCol: { span: 6 },
    wrapperCol: { span: 16 },
    schemas: getStructureDesForm(),
    showActionButtonGroup: false,
  });
</script>

<style scoped></style>
